package com.example.book_recommend.controller;

import com.example.book_recommend.pojo.VueResultInfo;
import com.example.book_recommend.service.PrivilegeService;
import com.example.book_recommend.utils.ResultFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@EnableAutoConfiguration
@CrossOrigin
@RequestMapping("api/privilege")
public class PrivilegeController {
    @Autowired
    PrivilegeService privilegeService;

    @RequestMapping("/getRights")
    @ApiOperation(value = "获取所有权限", notes = "...", httpMethod = "POST")
    public VueResultInfo getRights(){
        return ResultFactory.buildSuccessResult(privilegeService.getRights());
    }
}
